﻿Public Class DeleteDoc

    Private Sub DocumentBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Validate()
        Me.DocumentBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DigitalDocumentDataSet)

    End Sub

    Private Sub DeleteDoc_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DigitalDocumentDataSet.Document' table. You can move, or remove it, as needed.
        Me.DocumentTableAdapter.Fill(Me.DigitalDocumentDataSet.Document)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Validate()
        Me.DocumentTableAdapter.Delete(DelListBox.SelectedValue.ToString)
        Me.DocumentTableAdapter.Fill(Me.DigitalDocumentDataSet.Document)
        MsgBox("Deleted")

    End Sub
End Class